<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>后台管理</title>
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/common.css"/>    
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/main.css"/>    
    <link rel="stylesheet" type="text/css" href="/Public/Admin/css/Validform_v5.3.2_min.css"/>    
    <script type="text/javascript" src="/Public/static/jquery-2.1.4.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/libs/modernizr.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/libs/modernizr.min.js"></script>
    <script src="/Public/Admin/js/validateForm.js" ></script>
    <script type="text/javascript" src="/Public/Admin/js/Validform_v5.3.2_min.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/libs/alertAndConfirm.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery.uploadify.js"></script>
    <script type="text/javascript" src="/Public/Admin/js/jquery.uploadify.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/ueditor/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="/Public/ueditor/ueditor.all.min.js"></script>
    <script>
   Validator.ExtraRight = "<img src=\"/Public/Admin/images/check_right.gif\">&nbsp;"; //!!!! 此变量必须重新指定，默认为空值，请把它改成当验证成功时你想要显示的图标 !!!!//
   Validator.ExtraError = "<img src=\"/Public/Admin/images/check_error.gif\">&nbsp;"; //!!!! 此变量必须重新指定，默认为空值，请把它改成当验证失败时你想要显示的图标 !!!!//

</script>
</head>
<style type="text/css">
.pages {

    margin: 20px 350px;
}
.pages a,.pages span {
    display:inline-block;
    padding:2px 5px;
    margin:0 1px;
    border:1px solid #f0f0f0;
    -webkit-border-radius:3px;
    -moz-border-radius:3px;
    border-radius:3px;
}
.pages a,.pages li {
    display:inline-block;
    list-style: none;
    text-decoration:none; color:#58A0D3;
}
.pages a.first,.pages a.prev,.pages a.next,.pages a.end{
    margin:0;
}
.pages a:hover{
    border-color:#50A8E6;
}
.pages span.current{
    background:#50A8E6;
    color:#FFF;
    font-weight:700;
    border-color:#50A8E6;
}
</style>
<body>

<div class="topbar-wrap white">
    <div class="topbar-inner clearfix">
        <div class="topbar-logo-wrap clearfix">
            <h1 class="topbar-logo none"><a href="index.html" class="navbar-brand">后台管理</a></h1>
            <ul class="navbar-list clearfix">
                <li><a class="on" href="/Admin">首页</a></li>
                <li><a href="http://hubao.ynten.com/" target="_blank">网站首页</a></li>
            </ul>
        </div>
        <div class="top-info-wrap">
            <ul class="top-info-list clearfix">
                <?php if($_SESSION['adminname']): ?><li style="color:red"> 欢迎你：Admin</li>
                <?php else: ?> <li> 管理员</li><?php endif; ?>
                <li><a href="/Admin/Login/editpwd">修改密码</a></li>
                <li><a href="/Admin/Login/profile">修改资料</a></li>
                <li><a href="/Admin/Login/logout">退出</a></li>
            </ul>
        </div>
    </div>
</div>
<div class="container clearfix">
    <div class="sidebar-wrap">
        <div class="sidebar-content">
            <ul class="sidebar-list">
                 <li>
                    <a href="#"><i class="icon-font">&#xe003;</i>系统设置</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Other/index');?>"><i class="icon-font">&#xe008;</i>信息设置</a></li>
                        <li><a href="<?php echo U('Site/index');?>"><i class="icon-font">&#xe006;</i>网站设置</a></li>
						<li><a href="<?php echo U('Waiter/index');?>"><i class="icon-font">&#xe005;</i>客服设置</a></li>
                        <li><a href="<?php echo U('Site/flash');?>"><i class="icon-font">&#xe007;</i>幻灯管理</a></li>
                        <li><a href="<?php echo U('Url/index');?>"><i class="icon-font">&#xe009;</i>友情链接</a></li>
                        <li><a href="<?php echo U('Waiter/message');?>"><i class="icon-font">&#xe025;</i>短信邮箱账号</a></li>
                    </ul>
                </li>

			<li>
                    <a href="#"><i class="icon-font">&#xe035;</i>银行卡管理</a>
                    <ul class="sub-menu">
                        <li><a href="<?php echo U('Card/index');?>"><i class="icon-font">&#xe036;</i>银行卡列表</a></li>
                        <li><a href="<?php echo U('Card/insert');?>"><i class="icon-font">&#xe038;</i>银行卡添加</a></li>
                    </ul>
                </li>
		<!--  		<li>
                    <a href="#"><i class="icon-font">&#xe015;</i>财务审核</a>
                    <ul class="sub-menu">
                        <li><a href="/Admin/Gongshi/index"><i class="icon-font">&#xe034;</i>计划审核</a></li>
                        <li><a href="/Admin/Huo/index"><i class="icon-font">&#xe034;</i>活动审核</a></li>
                        <li><a href="/Admin/User/xian"><i class="icon-font">&#xe028;</i>提现订单</a></li>
                        <li><a href="#"><i class="icon-font">&#xe032;</i>财务总览</a></li>
                    </ul>
                </li>
                <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>公文配置</a>
                    <ul class="sub-menu">
                        <li><a href="/Admin/Gong/updatelc"><i class="icon-font">&&#xe022;</i>互保流程</a></li>
                        <li><a href="/Admin/Gong/index"><i class="icon-font">&#xe021;</i>互保公约</a></li>
                    </ul>
                </li> -->
				<li>
                    <a href="#"><i class="icon-font">&#xe050;</i>用户</a>
                    <ul class="sub-menu">
					    <li><a href="/Admin/User/index"><i class="icon-font">&#xe008;</i>会员中心</a></li>
						<!-- <li><a href="/Admin/Admin"><i class="icon-font">&#xe005;</i>管理员</a></li> -->
                        <!-- <li><a href="system.html"><i class="icon-font">&#xe031;</i>信用中心</a></li> -->
                        <!-- <li><a href="/Admin/Userfan/index"><i class="icon-font">&#xe039;</i>用户反馈</a></li> -->
                    </ul>
                </li>
                 <li>
                    <a href="#"><i class="icon-font">&#xe050;</i>管理员</a>
                    <ul class="sub-menu">
                        <li><a href="/Admin/Rbac/index"><i class="icon-font">&#xe008;</i>管理员</a></li>
                        <li><a href="/Admin/Rbac/role"><i class="icon-font">&#xe005;</i>角色管理</a></li>
                        <li><a href="/Admin/Rbac/jurisdiction"><i class="icon-font">&#xe039;</i>节点管理</a></li>
                    </ul>
                </li>
                 <li>
                    <a href="#"><i class="icon-font">&#xe018;</i>数据库备份</a>
                    <ul class="sub-menu">
                        <li><a href="/Admin/Bak/index"><i class="icon-font">&&#xe022;</i>数据备份</a></li>
                       <!--  <li><a href="/Admin/Gong/index"><i class="icon-font">&#xe021;</i>互保公约</a></li> -->
                    </ul>
                </li>
            </ul>
        </div>
    </div>
    
    <!--/sidebar-->

	<!--/sidebar-->
	<div class="main-wrap">

		<div class="crumb-wrap">
			<div class="crumb-list">
				<i class="icon-font"></i>
				<a href="/Admin/">首页</a>
				<span class="crumb-step">&gt;</span>
				<span class="crumb-name">角色分组列表</span>
			</div>
		</div>
		<div class="result-wrap">
			<form name="myform" id="myform" method="post">
				<div class="result-title">
					<div class="result-list">
						<a href="/Admin/Rbac/addrole">
							<i class="icon-font"></i>
							添加角色
						</a>
						<a id="batchDel" href="javascript:delall(<?php echo ($p); ?>)">
							<i class="icon-font"></i>
							批量删除
						</a>
					</div>
				</div>
				<div class="result-content">
					<table class="result-tab" width="1125">
						<tr id='tr'>
							<th class="tc" width="30">
								<input type="checkbox" class='chkall' />
							</th>
							<th width="30">ID</th>
							<th width="10%">角色</th>
							<th>权限</th>
							<th width="7%">操作</th>
						</tr>
						<?php if(is_array($list)): $i = 0; $__LIST__ = $list;if( count($__LIST__)==0 ) : echo "暂无数据" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><tr>
							<td class="tc">
								<input value="<?php echo ($vo["id"]); ?>" type="checkbox" name='id' class='chk'>
							</td>
							<td><?php echo ($vo["id"]); ?></td>
							<td><?php echo ($vo["name"]); ?></td>
							<td><?php echo ($vo["node"]); ?></td>
							<td>
								<a class="link-update"
									href="/Admin/Rbac/editrole/id/<?php echo ($vo["id"]); ?>">编辑</a>
								<a class="link-del" href="javascript:del(<?php echo ($vo["id"]); ?>);">删除</a>
							</td>
						</tr><?php endforeach; endif; else: echo "暂无数据" ;endif; ?>
						<tr>
							<td colspan='5'>
								<div class="pages"><?php echo ($page); ?></div>
							</td>
						</tr>
					</table>

				</div>
			</form>
		</div>
	</div>
	<!--/main-->

<script>
	
		//全选
		$('.chkall').click(function(){
			
			$(".chk").prop('checked',this.checked)
			
		})
		//单个删除
		function del(n){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				//发送 当前商品的id 和当前用户帐号
				$.post("/Admin/Rbac/delrole",{"id":n},function(d){
					
					$.MsgBox.Alert("删除提示", d);//删除后刷新本页
					location.reload();
					// window.setTimeout("window.location='/Admin/Rbac/role/p/"+p+".html'",1000);//1秒后 跳转
				});
			})
		}
		//多个删除
		function delall(p){
			//删除 商品 漂亮的提示信息
			$.MsgBox.Confirm("删除提示", "您确认删除该帐号", function () { 
				var str = "";
				$(".chk:checked").each(function(i,e){
					str += $(e).val()+",";
				})
				if(str == ""){
					$.MsgBox.Alert("提示","<span style='color:red;'>未选择</span>");
					return;
				}
				//发送 当前商品的id 和当前用户帐号
				$.post("/Admin/Rbac/delrole",{"id":str},function(d){
					$.MsgBox.Alert("删除提示", d);//删除后刷新本页
					window.setTimeout("window.location='/Admin/Rbac/role/p/"+p+".html'",1000);//1秒后 跳转
				});
				
			})
		}	
	
	</script>

    <!--/main-->
    <script>
  $(function(){
    // $('ul.sub-menu').hide();
        $('ul.sidebar-list>li>a').click(function(){
            $(this).next().toggle();
        })
    })
    </script>
</div>
</body>
</html>